package sz.szsmk.citizencard.ui.dialogs;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;

import androidx.annotation.NonNull;
import androidx.annotation.StyleRes;

import java.util.List;

import sz.szsmk.citizencard.R;
import sz.szsmk.citizencard.util.JumpUtils;

/**
 * author : hyt
 * date : 2020/6/5
 * description :
 */
public class RealNameCheckDialog  extends Dialog {

    Button btn_cancel;

    Button btn_ok;

    protected RealNameCheckDialog(@NonNull Context context, @StyleRes int themeResId) {
        super(context, R.style.alertdialog);
    }

    public RealNameCheckDialog(@NonNull Context context) {
        this(context, R.style.dialog);
        int divierId = context.getResources().getIdentifier("android:id/titleDivider", null, null);
        View divider = findViewById(divierId);
        divider.setVisibility(View.GONE);
    }


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(LayoutInflater.from(getContext()).inflate(R.layout.dialog_realnamecheck, null));
        btn_ok= findViewById(R.id.btn_ok);
        btn_cancel= findViewById(R.id.btn_cancel);

        initView();
    }

    private void initView() {
        btn_cancel.setOnClickListener(v ->
                RealNameCheckDialog.this.dismiss());
        btn_ok.setOnClickListener(v->{
            JumpUtils.jump(getContext(), "RealNameActivity", 0);
            this.dismiss();
        });


    }

}
